Optimal. Leaf size=125 \[ -\frac {a (5 A+4 B) \sin ^3(c+d x)}{15 d}+\frac {a (5 A+4 B) \sin (c+d x)}{5 d}+\frac {a (A+B) \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac {3 a (A+B) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {3}{8} a x (A+B)+\frac {a B \sin (c+d x) \cos ^4(c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 125, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {2968, 3023, 2748, 2633, 2635, 8} \[ -\frac {a (5 A+4 B) \sin ^3(c+d x)}{15 d}+\frac {a (5 A+4 B) \sin (c+d x)}{5 d}+\frac {a (A+B) \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac {3 a (A+B) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {3}{8} a x (A+B)+\frac {a B \sin (c+d x) \cos ^4(c+d x)}{5 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2633
Rule 2635
Rule 2748
Rule 2968
Rule 3023
Rubi steps
\begin {align*} \int \cos ^3(c+d x) (a+a \cos (c+d x)) (A+B \cos (c+d x)) \, dx &=\int \cos ^3(c+d x) \left (a A+(a A+a B) \cos (c+d x)+a B \cos ^2(c+d x)\right ) \, dx\\ &=\frac {a B \cos ^4(c+d x) \sin (c+d x)}{5 d}+\frac {1}{5} \int \cos ^3(c+d x) (a (5 A+4 B)+5 a (A+B) \cos (c+d x)) \, dx\\ &=\frac {a B \cos ^4(c+d x) \sin (c+d x)}{5 d}+(a (A+B)) \int \cos ^4(c+d x) \, dx+\frac {1}{5} (a (5 A+4 B)) \int \cos ^3(c+d x) \, dx\\ &=\frac {a (A+B) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {a B \cos ^4(c+d x) \sin (c+d x)}{5 d}+\frac {1}{4} (3 a (A+B)) \int \cos ^2(c+d x) \, dx-\frac {(a (5 A+4 B)) \operatorname {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{5 d}\\ &=\frac {a (5 A+4 B) \sin (c+d x)}{5 d}+\frac {3 a (A+B) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (A+B) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {a B \cos ^4(c+d x) \sin (c+d x)}{5 d}-\frac {a (5 A+4 B) \sin ^3(c+d x)}{15 d}+\frac {1}{8} (3 a (A+B)) \int 1 \, dx\\ &=\frac {3}{8} a (A+B) x+\frac {a (5 A+4 B) \sin (c+d x)}{5 d}+\frac {3 a (A+B) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (A+B) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {a B \cos ^4(c+d x) \sin (c+d x)}{5 d}-\frac {a (5 A+4 B) \sin ^3(c+d x)}{15 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.27, size = 77, normalized size = 0.62 \[ \frac {a \left (-160 (A+2 B) \sin ^3(c+d x)+480 (A+B) \sin (c+d x)+15 (A+B) (12 (c+d x)+8 \sin (2 (c+d x))+\sin (4 (c+d x)))+96 B \sin ^5(c+d x)\right )}{480 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.08, size = 88, normalized size = 0.70 \[ \frac {45 \, {\left (A + B\right )} a d x + {\left (24 \, B a \cos \left (d x + c\right )^{4} + 30 \, {\left (A + B\right )} a \cos \left (d x + c\right )^{3} + 8 \, {\left (5 \, A + 4 \, B\right )} a \cos \left (d x + c\right )^{2} + 45 \, {\left (A + B\right )} a \cos \left (d x + c\right ) + 16 \, {\left (5 \, A + 4 \, B\right )} a\right )} \sin \left (d x + c\right )}{120 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.66, size = 112, normalized size = 0.90 \[ \frac {3}{8} \, {\left (A a + B a\right )} x + \frac {B a \sin \left (5 \, d x + 5 \, c\right )}{80 \, d} + \frac {{\left (A a + B a\right )} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {{\left (4 \, A a + 5 \, B a\right )} \sin \left (3 \, d x + 3 \, c\right )}{48 \, d} + \frac {{\left (A a + B a\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (6 \, A a + 5 \, B a\right )} \sin \left (d x + c\right )}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.07, size = 128, normalized size = 1.02 \[ \frac {\frac {a B \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+a A \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+a B \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {a A \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.76, size = 124, normalized size = 0.99 \[ -\frac {160 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a - 15 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a - 32 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} B a - 15 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B a}{480 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.55, size = 236, normalized size = 1.89 \[ \frac {\left (\frac {3\,A\,a}{4}+\frac {3\,B\,a}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {29\,A\,a}{6}+\frac {13\,B\,a}{6}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {20\,A\,a}{3}+\frac {116\,B\,a}{15}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {35\,A\,a}{6}+\frac {19\,B\,a}{6}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (\frac {13\,A\,a}{4}+\frac {13\,B\,a}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {3\,a\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )\,\left (A+B\right )}{4\,d}+\frac {3\,a\,\mathrm {atan}\left (\frac {3\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A+B\right )}{4\,\left (\frac {3\,A\,a}{4}+\frac {3\,B\,a}{4}\right )}\right )\,\left (A+B\right )}{4\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 2.16, size = 333, normalized size = 2.66 \[ \begin {cases} \frac {3 A a x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 A a x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 A a x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 A a \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {2 A a \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {5 A a \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {A a \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 B a x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 B a x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 B a x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {8 B a \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {4 B a \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac {3 B a \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {B a \sin {\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} + \frac {5 B a \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (A + B \cos {\relax (c )}\right ) \left (a \cos {\relax (c )} + a\right ) \cos ^{3}{\relax (c )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________